package com.yxq.mdt.app.modules.search.ui;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yxq.mdt.app.R;

import java.util.List;

/**
 * @author L
 * @time 2019-10-21
 * @describe 搜索-搜索类型列表
 */
public class SearchTypeListAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public SearchTypeListAdapter(int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

        switch (helper.getLayoutPosition()) {
            case 0:
                helper.setImageResource(R.id.item_search_iv_icon, R.mipmap.icon_search_user);
                helper.setText(R.id.item_search_tv_title, String.format("搜索\"%s\"用户", item));
                break;
            case 1:
                helper.setImageResource(R.id.item_search_iv_icon, R.mipmap.icon_search_group);
                helper.setText(R.id.item_search_tv_title, String.format("搜索\"%s\"圈子", item));
                break;
            case 2:
                helper.setImageResource(R.id.item_search_iv_icon, R.mipmap.icon_search_topic);
                helper.setText(R.id.item_search_tv_title, String.format("搜索\"%s\"内容", item));
                break;
        }


    }

}
